package com.fap.core.bo.meta;

import com.fap.core.bo.define.FieldDefine;

public class FieldMeta {

	public static enum EnumFieldKind {BASIC,REFERENCE,DETAIL};
	public static enum EnumDataType {NUMBER,STRING,DATE,TIMESTAMP,LIST};	
	public static enum EnumVerifyRule {STRING_LENGTH,NUMBER_MAX};
		
	private FieldDefine _define;
	
	public FieldMeta(FieldDefine define){
		_define = define;
	}

	public String getId() {
		return _define.getId();
	}

	public String getName() {
		return _define.getName();
	}

	public String getFieldName() {
		return _define.getFieldName();
	}

	public String getTag() {
		return _define.getTag();
	}

	public EnumFieldKind getKind() {
		return EnumFieldKind.valueOf(_define.getKind());
	}

	public boolean isUsed() {
		return _define.getIsUsed().equals("1")?true:false;
	}

	public EnumDataType getDataType() {
		return EnumDataType.valueOf(_define.getDataType());
	}

	public boolean isAllowNull() {
		return _define.getAllowNull().equals("1")?true:false;
	}

	public int getLength() {
		return _define.getLength();
	}

	public String getDefaultData() {
		return _define.getDefaultData();
	}

	public EnumVerifyRule getVerifyRule() {
		return EnumVerifyRule.valueOf(_define.getVerifyRule());
	}

	public String getVerifyValue() {
		return _define.getVerifyValue();
	}

	public String getLinkBoId() {
		return _define.getLinkBoId();
	}

	public String getSubBoId() {
		return _define.getSubBoId();
	}
	
}
